(0) Obligation:
The Runtime Complexity (innermost) of the given
CpxTRS could be proven to be
BOUNDS(1, n^1).
The TRS R consists of the following rules:
prime(0) → false
prime(s(0)) → false
prime(s(s(x))) → prime1(s(s(x)), s(x))
prime1(x, 0) → false
prime1(x, s(0)) → true
prime1(x, s(s(y))) → and(not(divp(s(s(y)), x)), prime1(x, s(y)))
divp(x, y) → =(rem(x, y), 0)
Rewrite Strategy: INNERMOST
(1) CpxTrsToCdtProof (BOTH BOUNDS(ID, ID) transformation)
Converted Cpx (relative) TRS to CDT
(2) Obligation:
Complexity Dependency Tuples Problem
Rules:
prime(0) → false
prime(s(0)) → false
prime(s(s(z0))) → prime1(s(s(z0)), s(z0))
prime1(z0, 0) → false
prime1(z0, s(0)) → true
prime1(z0, s(s(z1))) → and(not(divp(s(s(z1)), z0)), prime1(z0, s(z1)))
divp(z0, z1) → =(rem(z0, z1), 0)
Tuples:
PRIME(0) → c
PRIME(s(0)) → c1
PRIME(s(s(z0))) → c2(PRIME1(s(s(z0)), s(z0)))
PRIME1(z0, 0) → c3
PRIME1(z0, s(0)) → c4
PRIME1(z0, s(s(z1))) → c5(DIVP(s(s(z1)), z0), PRIME1(z0, s(z1)))
DIVP(z0, z1) → c6
S tuples:
PRIME(0) → c
PRIME(s(0)) → c1
PRIME(s(s(z0))) → c2(PRIME1(s(s(z0)), s(z0)))
PRIME1(z0, 0) → c3
PRIME1(z0, s(0)) → c4
PRIME1(z0, s(s(z1))) → c5(DIVP(s(s(z1)), z0), PRIME1(z0, s(z1)))
DIVP(z0, z1) → c6
K tuples:none
Defined Rule Symbols:
prime, prime1, divp
Defined Pair Symbols:
PRIME, PRIME1, DIVP
Compound Symbols:
c, c1, c2, c3, c4, c5, c6
(3) CdtLeafRemovalProof (ComplexityIfPolyImplication transformation)
Removed 1 leading nodes:
PRIME(s(s(z0))) → c2(PRIME1(s(s(z0)), s(z0)))
Removed 5 trailing nodes:
PRIME(s(0)) → c1
PRIME(0) → c
PRIME1(z0, s(0)) → c4
DIVP(z0, z1) → c6
PRIME1(z0, 0) → c3
(4) Obligation:
Complexity Dependency Tuples Problem
Rules:
prime(0) → false
prime(s(0)) → false
prime(s(s(z0))) → prime1(s(s(z0)), s(z0))
prime1(z0, 0) → false
prime1(z0, s(0)) → true
prime1(z0, s(s(z1))) → and(not(divp(s(s(z1)), z0)), prime1(z0, s(z1)))
divp(z0, z1) → =(rem(z0, z1), 0)
Tuples:
PRIME1(z0, s(s(z1))) → c5(DIVP(s(s(z1)), z0), PRIME1(z0, s(z1)))
S tuples:
PRIME1(z0, s(s(z1))) → c5(DIVP(s(s(z1)), z0), PRIME1(z0, s(z1)))
K tuples:none
Defined Rule Symbols:
prime, prime1, divp
Defined Pair Symbols:
PRIME1
Compound Symbols:
c5
(5) CdtRhsSimplificationProcessorProof (BOTH BOUNDS(ID, ID) transformation)
Removed 1 trailing tuple parts
(6) Obligation:
Complexity Dependency Tuples Problem
Rules:
prime(0) → false
prime(s(0)) → false
prime(s(s(z0))) → prime1(s(s(z0)), s(z0))
prime1(z0, 0) → false
prime1(z0, s(0)) → true
prime1(z0, s(s(z1))) → and(not(divp(s(s(z1)), z0)), prime1(z0, s(z1)))
divp(z0, z1) → =(rem(z0, z1), 0)
Tuples:
PRIME1(z0, s(s(z1))) → c5(PRIME1(z0, s(z1)))
S tuples:
PRIME1(z0, s(s(z1))) → c5(PRIME1(z0, s(z1)))
K tuples:none
Defined Rule Symbols:
prime, prime1, divp
Defined Pair Symbols:
PRIME1
Compound Symbols:
c5
(7) CdtUsableRulesProof (EQUIVALENT transformation)
The following rules are not usable and were removed:
prime(0) → false
prime(s(0)) → false
prime(s(s(z0))) → prime1(s(s(z0)), s(z0))
prime1(z0, 0) → false
prime1(z0, s(0)) → true
prime1(z0, s(s(z1))) → and(not(divp(s(s(z1)), z0)), prime1(z0, s(z1)))
divp(z0, z1) → =(rem(z0, z1), 0)
(8) Obligation:
Complexity Dependency Tuples Problem
Rules:none
Tuples:
PRIME1(z0, s(s(z1))) → c5(PRIME1(z0, s(z1)))
S tuples:
PRIME1(z0, s(s(z1))) → c5(PRIME1(z0, s(z1)))
K tuples:none
Defined Rule Symbols:none
Defined Pair Symbols:
PRIME1
Compound Symbols:
c5
(9) CdtRuleRemovalProof (UPPER BOUND(ADD(n^1)) transformation)
Found a reduction pair which oriented the following tuples strictly. Hence they can be removed from S.
PRIME1(z0, s(s(z1))) → c5(PRIME1(z0, s(z1)))
We considered the (Usable) Rules:none
And the Tuples:
PRIME1(z0, s(s(z1))) → c5(PRIME1(z0, s(z1)))
The order we found is given by the following interpretation:
Polynomial interpretation :
POL(PRIME1(x1, x2)) = x2
POL(c5(x1)) = x1
POL(s(x1)) = [1] + x1
(10) Obligation:
Complexity Dependency Tuples Problem
Rules:none
Tuples:
PRIME1(z0, s(s(z1))) → c5(PRIME1(z0, s(z1)))
S tuples:none
K tuples:
PRIME1(z0, s(s(z1))) → c5(PRIME1(z0, s(z1)))
Defined Rule Symbols:none
Defined Pair Symbols:
PRIME1
Compound Symbols:
c5
(11) SIsEmptyProof (BOTH BOUNDS(ID, ID) transformation)
The set S is empty
(12) BOUNDS(1, 1)